#include<stdio.h>

int main(int argc, char const *argv[])
{
    int n,temp,max=1;
    int a[10000],maxarr[1000]={1};
    scanf("%d",&n);
    scanf("%d",&a[0]);
    for (int i = 1; i < n; i++)
    {
        scanf("%d",&a[i]);
        maxarr[i] = 1;
        if (a[i]-1==a[i-1]){maxarr[i]+=maxarr[i-1];}
        max = max>maxarr[i]? max:maxarr[i];
        
    }
    
    printf("%d",max);
    

    return 0;
}
